var Page = {
    home        : require("./routes/home"),
    token       : require("./routes/token"),
    error       : require("./routes/error"),
    admin       : {
        home        : require("./routes/admin/home"),
        index       : require("./routes/admin/platform"),
        login       : require('./routes/admin/login'),
        register    : require('./routes/admin/register')
    }
};

var routes = function(){

    // 首页
    this.use('/', Page.home);
    this.use('/token', Page.token);

    //管理
    this.use('/admin', Page.admin.home);
    this.use('/admin/index', Page.admin.index);
    this.use('/admin/login', Page.admin.login);
    this.use('/admin/register', Page.admin.register);

    // error
    this.use(Page.error[404]);
    this.use(Page.error);
};

module.exports = routes;
